package com.example.mybatisdemo.enums;

public enum TableUpdateEnum {

    USER("user",new String[]{"name"});


    private String tableName;
    private String[] changeField;

    TableUpdateEnum(String tableName, String[] changeField) {
        this.tableName = tableName;
        this.changeField = changeField;

    }

    public static TableUpdateEnum getByTableName(String tableName){
        for (TableUpdateEnum value : TableUpdateEnum.values()) {
            if(value.tableName.equals(tableName)){
                return value;
            }
        }
        return null;
    }

    public String getTableName() {
        return tableName;
    }

    public String[] getChangeField() {
        return changeField;
    }

}
